<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<label>姓名</label> <input id="userName" type="text">
<button onclick="seatSubmit()">提交</button>
</body>
<script src="js/jquery-3.5.1.js"></script>

<script>
    function seatSubmit() {
        var temp = {}
        console.log(temp.data == null)
        console.log($('#userName').val().substr(0, 5))
        if ($('#userName').val().length === 0) {
            alert('请输入姓名')
            return false
        }
    }

</script>
</html>